package com.pdstudio.carrecom.ui.activity.myclub;

import com.pdstudio.carrecom.R;
import com.pdstudio.carrecom.api.ServiceHelper;
import com.pdstudio.carrecom.app.AppContext;
import com.pdstudio.carrecom.ui.activity.ActivityWebView;

import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * 更多有趣的东西
 * 类: ActivityMyClubMore <br>
 * 描述: TODO <br>
 * 作者: xiangzhaoyu  <br>
 * 时间: 2015-6-15 下午3:46:55
 */
public class ActivityMyClubMore extends Activity {

	private View customLiveIndexTitleView;
	private TextView txtTitle;
	private ImageView ivBack;
	
	private int currentFrag=1;//1表示step1,2表示step2
	private Fragment currentFragment;
	
	private LinearLayout mOne,mTwo,mThree,mFour;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_myclub_more);

		initTitle();
		InitialView();
	}
	
	private void initTitle() {
		txtTitle = (TextView) findViewById(R.id.title_text_nav);

		txtTitle.setText("更多有趣的东西");

		ivBack = (ImageView) findViewById(R.id.title_back);
		ivBack.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();				
			}
		});
	}
	
	private void InitialView(){
		
		mOne=(LinearLayout)findViewById(R.id.myclub_westbirthluck);
		mOne.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent=new Intent(ActivityMyClubMore.this,ActivityWebView.class);
				intent.putExtra("url", ServiceHelper.XZYS);
				intent.putExtra("title", "星座运势");
				startActivity(intent);
			}});
		mTwo=(LinearLayout)findViewById(R.id.myclub_birthluck);
		mTwo.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent=new Intent(ActivityMyClubMore.this,ActivityWebView.class);
				intent.putExtra("url", ServiceHelper.SX);
				intent.putExtra("title", "生肖");
				startActivity(intent);
			}});
		mThree=(LinearLayout)findViewById(R.id.myclub_news);
		mThree.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent=new Intent(ActivityMyClubMore.this,ActivityWebView.class);
				intent.putExtra("url", ServiceHelper.XWBG);
				intent.putExtra("title", "新闻八卦");
				startActivity(intent);
			}});
		mFour=(LinearLayout)findViewById(R.id.myclub_yourlife);
		mFour.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent=new Intent(ActivityMyClubMore.this,ActivityWebView.class);
				intent.putExtra("url", ServiceHelper.SMCZ);
				intent.putExtra("title", "算命测字");
				startActivity(intent);
			}});
		
		switch(currentFrag){
		case 1:{
			
			
		}break;
		case 2:{
			
		}break;
		default:{
			
		}break;
		}
		openFragment(currentFragment);
	}
	
	public void openFragment(Fragment f){
		try{
			getFragmentManager().beginTransaction()
			.replace(R.id.fg_fragment, f).commit(); // 允许丢失状态
			currentFragment=f;
		}catch(Exception e){}
	}

	
}
